# 指定 requirements.txt 文件的路径
requirements_file = './requirements.txt'  # 替换为你的文件路径

# 打开并读取文件，指定编码为 utf-8
with open(requirements_file, 'r', encoding='utf-16') as file:
    lines = file.readlines()

# 过滤掉包含 "@ file://" 的行
filtered_lines = [line for line in lines if "@ file://" not in line]

# 将过滤后的内容写回文件
with open(requirements_file, 'w', encoding='utf-16') as file:
    file.writelines(filtered_lines)

print("Filtered requirements.txt successfully!")
